package com.kevin.actoviti.day01;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.repository.Deployment;

/**
 * @Classname ActivitiDelpment
 * @Description 流程定义的部署
 * @Date 2020/6/20 23:48
 * @Created by kevin
 */
public class ActivitiDelpment {

    public static void main(String[] args) {

        //1.创建ProcessEngine对象
        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
        //2.得到RepositoryService实力
        RepositoryService repositoryService = processEngine.getRepositoryService();
        //3.进行部署
        Deployment deployment = repositoryService.createDeployment()
                .addClasspathResource("diagram/holiday.bpmn")
                .addClasspathResource("diagram/holiday.png")
                .name("请假流程申请单")
                .deploy();

        System.out.println(deployment.getId());
        System.out.println(deployment.getName());
        System.out.println(deployment.getCategory());
        System.out.println(deployment.getKey());
        System.out.println(deployment.getTenantId());
    }
}
